package gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

/**
 * <b>Project ChatSystemG6 INSA 4INFOA1 - 2013/2014</b>
 * <P>
 * <i>Package gui </i> <br>
 * Class DefaultTab the tab displayed by default when the local connect the
 * first time and show all the notifications about the chatSystem<br>
 * 
 * @author Christelle SIAGO HAPPI
 */
@SuppressWarnings("serial")
public class DefaultTab extends JPanel {

	private JTextArea presentation;
	private JLabel welcomeTextLabel;
	private ImagePanel panel; // the panel of this frame
	private JScrollPane scroll;

	/**
	 * the constructor
	 */
	public DefaultTab() {
		initComponents();
	}

	/**
	 * init the components
	 */
	private void initComponents() {

		welcomeTextLabel = new JLabel("WELCOME TO THE CHATSYSTEM\n");
		welcomeTextLabel.setForeground(Color.BLUE);

		presentation = new JTextArea();
		presentation.setEditable(false);

		presentation.setFont(new Font("Tahoma", 2, 12));
		presentation.setBackground(Color.CYAN);
		// putting a scroll to the list
		scroll = new JScrollPane(presentation);

		this.setLayout(new BorderLayout());
		this.add(welcomeTextLabel, BorderLayout.NORTH);
		this.add(scroll, BorderLayout.CENTER);
		
		
		//this.add(panel, BorderLayout.CENTER);

	}

	/**
	 * set a new alarm
	 * 
	 * @param message
	 *            : the alarm to display
	 */
	public void setNotification(String message) {
		presentation.append("\n" + message + "\n");
	}
}